package com.ass.tts.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 *
 * @description : 适配TTS 枚举
 * @author : liyong
 * @date : 2025-06-19 16:32:08
 * @since :1.0
 **/
@Getter
@AllArgsConstructor
public enum TTSEnum {

    //GPT_SoVITS
    GPT_SOVITS("01","github","GS","gs"),

    //retrieval-based-voice-conversion-web-ui
    RBVC_WEB_UI("02","github","RBVCWEB","rbvcweb"),

    ;
    //平台标识
    private String code;

    //所属厂家
    private String manufacturer;

    private String uppercase;

    private String lowercase;




    /**
     * 获取大写uppercase的全部属性
     *
     * @author: Li yong
     * @date: 2024/3/21 10:09
     * @param uppercase:
     * @return: com.sx.common.SourceEnum
     */
    public static TTSEnum getLLMEnumByUpper(String uppercase) {
        return Arrays.stream(TTSEnum.values())
                .filter(source->source.uppercase.equals(uppercase))
                .findFirst().orElse(null);
    }

    /**
     * 获取小写lowercase的全部属性
     *
     * @author: Li yong
     * @date: 2024/3/21 10:09
     * @param lowercase:
     * @return: com.sx.common.SourceEnum
     */
    public static TTSEnum getLLMEnumByLower(String lowercase) {
        return Arrays.stream(TTSEnum.values())
                .filter(source->source.lowercase.equals(lowercase))
                .findFirst().orElse(null);
    }


}
